# -*- encoding:utf-8 -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 5
_modified_time = 1292135864.944375
_template_filename=u'/Users/joeldunham/old/onlinelinguisticdatabase/templates/derived/collection/addUpdateFields.html'
_template_uri=u'/derived/collection/addUpdateFields.html'
_template_cache=cache.Cache(__name__, _modified_time)
_source_encoding='utf-8'
from webhelpers.html import escape
_exports = ['primaryData', 'add', 'update', 'whoAndWhen']


def _mako_get_namespace(context, name):
    try:
        return context.namespaces[(__name__, name)]
    except KeyError:
        _mako_generate_namespaces(context)
        return context.namespaces[(__name__, name)]
def _mako_generate_namespaces(context):
    # SOURCE LINE 1
    ns = runtime.Namespace(u'helper', context._clean_inheritance_tokens(), templateuri=u'/base/helper.html', callables=None, calling_uri=_template_uri, module=None)
    context.namespaces[(__name__, u'helper')] = ns

    # SOURCE LINE 2
    ns = runtime.Namespace(u'javascriptDefs', context._clean_inheritance_tokens(), templateuri=u'/base/javascriptDefs.html', callables=None, calling_uri=_template_uri, module=None)
    context.namespaces[(__name__, u'javascriptDefs')] = ns

def render_body(context,**pageargs):
    context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        _import_ns = {}
        _mako_get_namespace(context, u'helper')._populate(_import_ns, [u'markdownHelp', u'formEmbeddingHelp', u'entityLinkingHelp', u'reStructuredTextHelp', u'embeddingFileHelp'])
        _mako_get_namespace(context, u'javascriptDefs')._populate(_import_ns, [u'getMemoryContentsScript'])
        __M_writer = context.writer()
        # SOURCE LINE 1
        __M_writer(u'\n')
        # SOURCE LINE 2
        __M_writer(u'\n\n')
        # SOURCE LINE 7
        __M_writer(u'\n\n\n')
        # SOURCE LINE 13
        __M_writer(u'\n\n\n')
        # SOURCE LINE 77
        __M_writer(u'\n\n\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_primaryData(context):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'helper')._populate(_import_ns, [u'markdownHelp', u'formEmbeddingHelp', u'entityLinkingHelp', u'reStructuredTextHelp', u'embeddingFileHelp'])
        _mako_get_namespace(context, u'javascriptDefs')._populate(_import_ns, [u'getMemoryContentsScript'])
        entityLinkingHelp = _import_ns.get('entityLinkingHelp', context.get('entityLinkingHelp', UNDEFINED))
        url = _import_ns.get('url', context.get('url', UNDEFINED))
        h = _import_ns.get('h', context.get('h', UNDEFINED))
        getMemoryContentsScript = _import_ns.get('getMemoryContentsScript', context.get('getMemoryContentsScript', UNDEFINED))
        formEmbeddingHelp = _import_ns.get('formEmbeddingHelp', context.get('formEmbeddingHelp', UNDEFINED))
        reStructuredTextHelp = _import_ns.get('reStructuredTextHelp', context.get('reStructuredTextHelp', UNDEFINED))
        embeddingFileHelp = _import_ns.get('embeddingFileHelp', context.get('embeddingFileHelp', UNDEFINED))
        app_globals = _import_ns.get('app_globals', context.get('app_globals', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 16
        __M_writer(u'\n ')
        # SOURCE LINE 17
 
        sUrl = url(controller='collection', action='getmemory') 
        getMemoryContentsScript()
         
        
        # SOURCE LINE 20
        __M_writer(u'\n \n <fieldset>\n <legend>Primary Data</legend>\n <ol>\n  <li>\n   <label for="title">Title *</label>\n   <input id="title" maxlength="255" name="title" tabindex="1" type="text" />\n  </li>\n  <li>\n   <label for="url">URL</label>\n   <input id="url" maxlength="255" name="url" tabindex="1" type="text" />\n  </li>\n  <li>\n   <label for="collectionType">Type</label>\n   ')
        # SOURCE LINE 35
        __M_writer(escape(h.select(name=u'type', selected_values=u"", options=app_globals.collectionTypes, tabindex=2)))
        __M_writer(u'\n  </li> \n  <li>\n   <label for="description">Description</label>\n   <textarea id="description" name="description" rows="2" cols="10" tabindex="3"></textarea>\n  </li>\n  <li>\n   <label for="collectionContent">Content</label>\n   <textarea id="collectionContent" class="monospace" name="contents" rows="20"\n           cols="10" tabindex="4"></textarea>\n\n   <a class="buttonLink" name="getmemory" href=\'#\'\n    onclick="getMemoryContents(\'')
        # SOURCE LINE 47
        __M_writer(escape(sUrl))
        __M_writer(u'\'); return false;"\n    title="Insert Form IDs from Memory into this Collection\'s content">\n    insert contents of memory</a>\n\n   <p class="fullyjustified">Enter some content for this collection in the text\n   box above.</p>\n   \n   <p class="fullyjustified">To embed the Form with ID=X, use the syntax \'form[X]\'\n   ')
        # SOURCE LINE 55
        __M_writer(escape(formEmbeddingHelp()))
        __M_writer(u'.  (Each embedded Form will be associated to this\n   Collection, making it possible (for example) to search within the set of\n   Forms Y that are associated to the set of Collections Z.)</p>\n \n   <p class="fullyjustified">Use the reStructuredText markup language\n   ')
        # SOURCE LINE 60
        __M_writer(escape(reStructuredTextHelp()))
        __M_writer(u' to add formatting and structure.</p>\n   \n   <p class="fullyjustified">Embed a representation of an OLD File\n   ')
        # SOURCE LINE 63
        __M_writer(escape(embeddingFileHelp()))
        __M_writer(u' using an expression of the form \'file[X]\'.</p>\n\n   <p class="fullyjustified">Embed the contents of another OLD Collection with\n   expressions of the form \'collection[X]\'.  By embedding the contents of\n   multiple Collections, one can create a Collection whose contents is built up\n   from those of others.</p>\n   \n   <p class="fullyjustified">Create HTML links to OLD entities using\n   expressions of the form \'form(a)\', \'collection(b)\', etc., where \'a\' and \'b\'\n   are IDs ')
        # SOURCE LINE 72
        __M_writer(escape(entityLinkingHelp()))
        __M_writer(u'.</p>\n  \n  </li>\n </ol>\n </fieldset>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_add(context):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'helper')._populate(_import_ns, [u'markdownHelp', u'formEmbeddingHelp', u'entityLinkingHelp', u'reStructuredTextHelp', u'embeddingFileHelp'])
        _mako_get_namespace(context, u'javascriptDefs')._populate(_import_ns, [u'getMemoryContentsScript'])
        def primaryData():
            return render_primaryData(context)
        def whoAndWhen():
            return render_whoAndWhen(context)
        __M_writer = context.writer()
        # SOURCE LINE 4
        __M_writer(u'\n ')
        # SOURCE LINE 5
        __M_writer(escape(primaryData()))
        __M_writer(u'\n ')
        # SOURCE LINE 6
        __M_writer(escape(whoAndWhen()))
        __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_update(context):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'helper')._populate(_import_ns, [u'markdownHelp', u'formEmbeddingHelp', u'entityLinkingHelp', u'reStructuredTextHelp', u'embeddingFileHelp'])
        _mako_get_namespace(context, u'javascriptDefs')._populate(_import_ns, [u'getMemoryContentsScript'])
        def primaryData():
            return render_primaryData(context)
        def whoAndWhen():
            return render_whoAndWhen(context)
        __M_writer = context.writer()
        # SOURCE LINE 10
        __M_writer(u'\n ')
        # SOURCE LINE 11
        __M_writer(escape(primaryData()))
        __M_writer(u'\n ')
        # SOURCE LINE 12
        __M_writer(escape(whoAndWhen()))
        __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_whoAndWhen(context):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'helper')._populate(_import_ns, [u'markdownHelp', u'formEmbeddingHelp', u'entityLinkingHelp', u'reStructuredTextHelp', u'embeddingFileHelp'])
        _mako_get_namespace(context, u'javascriptDefs')._populate(_import_ns, [u'getMemoryContentsScript'])
        h = _import_ns.get('h', context.get('h', UNDEFINED))
        app_globals = _import_ns.get('app_globals', context.get('app_globals', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 80
        __M_writer(u'\n<fieldset>\n<legend>Who and When</legend>\n<ol>\n <li>\n  <label for="speaker">Speaker</label>\n  ')
        # SOURCE LINE 86
        speakers = [('', '')] + app_globals.speakers 
        
        __M_writer(u'\n  ')
        # SOURCE LINE 87
        __M_writer(escape(h.select(name='speaker', selected_values="", options=speakers, tabindex=5)))
        __M_writer(u'\n </li>\n <li>\n  <label for="elicitor">Elicitor</label>\n  ')
        # SOURCE LINE 91
        users = [('', '')] + app_globals.users 
        
        __M_writer(u'\n  ')
        # SOURCE LINE 92
        __M_writer(escape(h.select(name='elicitor', selected_values="", options=users, tabindex=6)))
        __M_writer(u'\n </li>\n <li>\n  <label for="source">Source</label>\n  ')
        # SOURCE LINE 96
        sources = [('', '')] + app_globals.sources 
        
        __M_writer(u'\n  ')
        # SOURCE LINE 97
        __M_writer(escape(h.select(name='source', selected_values="", options=sources, tabindex=7)))
        __M_writer(u'\n </li>\n <li>\n  <label for="dateElicited">Date Elicited (MM/DD/YYYY)</label>\n  <input id="dateElicited" maxlength="10" name="dateElicited" tabindex="8" type="text" />\n </li>\n</ol>\n</fieldset>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


